home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
PET
/
S-Super PET
/
(s)tl.d64
/
HELLO.ASM
< prev
next >
Wrap
Assembly Source File
|
2009-01-18
|
5KB
|
147 lines
; Hello.asm by T.M. Peterson Mod of Feb 3 1984
; Preliminary routine for Sys_Patch & GScroll
xref printf_,setdate_,settime_,tputcurs_,getrec_,stoi_
loadcmd equ $AC20 ;ROM routine to load program
hello equ *
ldd #hello_msg
jsr printf_
bsr rd_wt_tst ;Test switch setting.
ldd #$1201
jsr TPutCurs_
ldd #get_date_msg
bsr input_rec
if ne
ldx #beg_buf
clr b,x ;Dump <CR>
tfr x,d
jsr setdate_
endif
ldd #get_time_msg
bsr input_rec
if ne
ldx #beg_buf
ldy #time_buf
loop
pshs y
bsr get_time_byte
puls y
quif eq ;no more string
stb ,y+
cmpx #end_buf
until ge
ldd #time_buf
jsr settime_
endif
ldd #gscroll_name
jsr loadcmd ;chain to gscroll before quitting
if ne ;successful load
clra
bsr mem_set ;write protect banks
jmp [$2A]
endif
clr $32 ;else just quit
rts
input_rec equ *
jsr printf_ ;Print prompt
ldd #end_buf-beg_buf
pshs d
ldd #beg_buf
jsr GetRec_ ;Accept response
leas 2,s
tstb ;Get any chars?
rts
get_time_byte equ *
pshs x ;save starting place
loop
ldb ,x+
quif eq ;end of string
subb #':
until eq
clr ,-x ;make ':' into string term.
cmpx ,s ;any chars?
if ne ;yes
inx
ldd ,s ;point to start
stx ,s ;save cur. pos.
jsr StoI_ ;make #
ldx ,s
endif
leas 2,s
rts
rd_wt_tst equ *
bsr wrt_set ;Try to enable write.
beq warn ;Can't wrt, warn of read_only setting
clra ;OK, we can write, but can we set prot.?
bsr mem_set ;Try READ only setting.
bne warn ;Oops, can't protect.
ldd #success ;OK, tell good news.
jsr printf_
;Fall through to enable write.
wrt_set lda #2 ;Enable write to banked RAM
mem_set equ * ;Set system latch bits according to [A]
ldb #$80 ;access system latch
orb $220 ;add current bank number
stb $effc
sta $eff8 ;Set the bits
andb #$f
stb $effc ;restore bank latch
lda $9000 ;Now, can we write?
dec $9000
cmpa $9000 ;Did it take?
pshs cc
sta $9000 ;Restore, in case it DID.
puls cc
rts
warn equ *
ldd #warning
bsr input_rec
leas 2,s
lbra hello
warning fcb $d,$d
fcc "Please set your banked RAM memory switch to 'PROG.'"
fcb $D,$D
fcc " (Press RETURN when ready to proceed.)"
fcb $D,$D,0
success fcb $d,$d
fcc "You may now LEAVE your Memory Switch in 'PROG.' whenever"
fcb $d,$d
fcc "'gscroll' has been run from the main menu. (As I will do"
fcb $d,$d
fcc "for you after you've answered the following two questions.)"
fcb 0
hello_msg fcb 12,10,10,10
fcc " Hello! I hope you like this modification"
fcb $D,$D
fcc " of the SuperPET's operating system."
fcb $d,$d,$d
fcc " Terry M. Peterson February 3, 1984"
fcb $d,0
get_date_msg fcc "Please enter the date (string or CR)."
fcb $D,0
get_time_msg fcc "Please enter the time (HH:MM:SS or CR)."
fcb $D,0
gscroll_name fcc "disk/1.gscroll"
fcb 0
time_buf fcb 0,0,0,0
beg_buf equ *
end_buf equ *+80
end